<template>
  <el-form>
    <el-button-group style="margin-bottom:20px;">
      <el-button size="small" icon="el-icon-view" @click="link_detail">查看</el-button>
      <el-button size="small" icon="el-icon-edit">编辑</el-button>
      <el-button size="small" icon="el-icon-circle-close-outline">删除</el-button>
      <el-button size="small" icon="el-icon-plus">新增</el-button>
      <el-button size="small" icon="el-icon-plus" :disabled="multipleSelection.length === 0" @click="handleDownloadXlsx(multipleSelection)">下载</el-button>
    </el-button-group>
  </el-form>
</template>
<script>
export default {
  props: ['multipleSelection'],
  methods: {
    link_detail () {
      if (this.multipleSelection.length > 1) {
        this.$message('只能选择一个哦')
      } else {
        this.$emit('link_detail', this.multipleSelection[0].id)
      }
    },
    handleDownloadXlsx () {
      this.$emit('handleDownloadXlsx', this.multipleSelection)
    }
  }
}
</script>
